#ifndef _SE_OPENGLAPI_
#define _SE_OPENGLAPI_

#include "Render/RenderAPI.h"

namespace SE
{
	class OpenGLAPI : public RenderAPI
	{
	public:
        OpenGLAPI();
        virtual ~OpenGLAPI();

        virtual RenderAPIType getAPIType() const override;

        virtual void makeContextCurrent(const Ref<RenderContext>& context) override;

        virtual void setViewport(
            const U32 x,
            const U32 y,
            const U32 width,
            const U32 height
        ) override;
        virtual void setClearColor(const Vector4f& color) override;
        virtual void setLineWidth(const Float width) override;

        virtual void clear() override;

        virtual void beginScene(const CameraData cameraData) override;
        virtual void endScene() override;

        virtual void startBatch() override;
        virtual void nextBatch() override;
        virtual void flush() override;
        virtual void resetStats() override;

        virtual void enableTests(const EnabledTest enabledTests) override;
        virtual void disableTests(const EnabledTest enabledTests) override;

        virtual void drawIndexed(const Ref<VertexArray>& vertexArray, const U64 indexCount) override;
        virtual void drawArrays(const Ref<VertexArray>& vertexArray, const U64 vertexCount) override;
        virtual void drawLines(const Ref<VertexArray>& vertexArray, const U64 vertexCount) override;
        
        virtual void submitTriangles(
            RenderVertex*   vertices,
            const U32       vertexCount,
            U32*            indices,
            const U32       indexCount) override;

        virtual void submitTriangles(
            const RenderVertex2D*   vertices,
            const U32               triangleCount,
            const Matrix4f&         transform,
            const Ref<Texture>&     texture,
            const Float             tilingFactor,
            const I32               entityID) override;

        virtual void submitTriangles(
            const RenderVertex3D*   vertices,
            const U32               triangleCount,
            const Matrix4f&         transform,
            const Ref<Texture>&     texture,
            const Float             tilingFactor,
            const I32               entityID) override;

        virtual void submitQuads(
            const RenderVertex2D*   vertices,
            const U32               quadCount,
            const Matrix4f&         transform,
            const Ref<Texture>&     texture,
            const Float             tilingFactor,
            const I32               entityID) override;

        virtual void submitQuads(
            const RenderVertex3D*   vertices,
            const U32               quadCount,
            const Matrix4f&         transform,
            const Ref<Texture>&     texture,
            const Float             tilingFactor,
            const I32               entityID) override;
	};
}

#endif // !_SE_OPENGLAPI_